<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>苏豫强的作业</title>

</head>

<body>

    <button id="bt1">这里</button>


    <div id="box">点上边获取验证码</div>


    <script>
        // 验证码   
        var arr = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcbnm1235678904"
        sj = setInterval(function () {
            bt1.onclick = function () {

                var b = ""
                for (var i = 0; i < 4; i++) {

                    b += arr[Math.floor(Math.random() * arr.length)]
                }
                bt1.innerHTML = b
            }
        }, 1)
    </script>









</body>

</html>